package com.iweb.blog.api;

import com.iweb.blog.service.TagService;
import com.iweb.blog.vo.Result;
import com.iweb.blog.vo.TagVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("tags")
public class TagController {
    @Autowired
    private TagService tagService;

    @GetMapping("hot")
    public Result hot(){
        int limit=3;
        List<TagVo>tagvoList=tagService.findHotTag(limit);
        return Result.success(tagvoList);
    }
}
